/*
*楼宇和房间接口调用的函数封装
* */
import axios from "@/utils/http.js";
import * as buildingURL from "@/api/url.js";

/**
 * 封装获取楼宇列表的函数
 */
export const getBuildingList = (params) => {
    return axios({
        method: "get",
        url: buildingURL.buildingListURL,
        params,
    });
};

/**
 * 封装根据id删除楼宇的函数
 */
export function deleteBuildById(data) {
    return axios({
        method: "delete",
        url: buildingURL.deleteBuildingURL,
        data,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded",
        },
    });
}

/**
 * 添加楼宇的函数
 */
export const addBuilding = (data) => {
    return axios({
        method: "post",
        url: buildingURL.addBuildingURL,
        data,
    });
};

/**
 * 修改楼宇的函数
 */
export const updateBuilding = (data) => {
    return axios({
        method: "put",
        url: buildingURL.updateBuildingURL,
        data,
    });
};
